<template>
  <div>
     <h1>父组件</h1>
    <button @click="getMoney">获取金额</button>
    <div>
      <son-com car="宝马车" :money="money" @changeMoney="changeFn"></son-com>
    </div>
  </div>
</template>

<style lang="less">

</style>
<script setup>
import {ref} from "vue";
import SonCom from "@/components/Son-com.vue";
const money = ref(100)
const getMoney =()=>{
  money.value += 100
}
const changeFn=(newMoney)=>{
  money.value-=newMoney
}
</script>
